﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Views/Shared/Site.Master" Inherits="System.Web.Mvc.ViewPage<IEnumerable<Sisocana.Core.Models.UsuarioModel>>" %>

<asp:Content ID="Content1" ContentPlaceHolderID="TitleContent" runat="server">
    Users List
</asp:Content>

<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">
<script src="<%: Url.Content("~/Scripts/jquery.validate.min.js") %>" type="text/javascript"></script>
<script src="<%: Url.Content("~/Scripts/jquery.validate.unobtrusive.min.js") %>" type="text/javascript"></script>
<script src="<%: Url.Content("~/Scripts/jquery-1.5.1.js") %>" type="text/javascript"></script>
<script src="<%: Url.Content("~/Scripts/jquery-ui-1.8.11.js") %>" type="text/javascript"></script>
<link href="<%: Url.Content("~/Content/themes/base/jquery.ui.all.css") %>" rel="stylesheet" type="text/css" />
<script language="javascript" type="text/javascript">
    $(document).ready(function () {

        $("button, input:submit , input:file , p a").button();
    });
</script>
<h2>Users List</h2>
<script src="<%: Url.Content("~/Scripts/jquery.validate.min.js") %>" type="text/javascript"></script>
<script src="<%: Url.Content("~/Scripts/jquery.validate.unobtrusive.min.js") %>" type="text/javascript"></script>
<script src="<%: Url.Content("~/Scripts/jquery-1.5.1.js") %>" type="text/javascript"></script>
<script src="<%: Url.Content("~/Scripts/jquery-ui-1.8.11.js") %>" type="text/javascript"></script>
<link href="<%: Url.Content("~/Content/themes/base/jquery.ui.all.css") %>" rel="stylesheet" type="text/css" />
<script language="javascript" type="text/javascript">
    $(document).ready(function () {

        $("button, input:submit , input:file , p a").button();
    });
</script>
<p>
    <%: Html.ActionLink("Create New", "Register") %>
</p>
<table>
    <tr>
        <th></th>
        <th>
            User name
        </th>
        <th>
            E-mail adress
        </th>
        <th>
            Type
        </th>
        
    </tr>

<% foreach (var item in Model) { %>
    <tr>
        <td>
           <%-- <%: Html.ActionLink("Edit", "Edit", new { /* id=item.PrimaryKey */ }) %> |           
            <%: Html.ActionLink("Delete", "Delete", new { /* id=item.PrimaryKey */ }) %>--%>

             <%= Html.MakeImgLink(Url.Action("Edit", "Account", new { name = item.nombreUsuario }), "Edit", "edit.png")%> |
               <%= Html.MakeImgLink(Url.Action("Delete", "Account", new { name = item.nombreUsuario }), "Delete", "delete.png")%>

        </td>
        <td>
            <%: Html.DisplayFor(modelItem => item.nombreUsuario,"Name") %>
        </td>
        <td>
            <%: Html.DisplayFor(modelItem => item.email,"Email") %>
        </td>
        <td>
            <% if (item.tipo == "G")
                { %>
            General admin
            <% } if (item.tipo == "S") 
               {%>
            Site admin
            <% } %>
        </td>
        
    </tr>
<% } %>

</table>

</asp:Content>

<asp:Content ID="Content3" ContentPlaceHolderID="HeaderContent" runat="server">
</asp:Content>
